{% extends 'base.html' %}

{% block head %}
    <script type="text/javascript" src="/static/js/jquery-ui.min.js"></script>
	<script type="text/javascript" src="/static/js/slide.js"></script>
{% endblock head %}

{% block center_body %}

	<div class="navbar_con">
		<div class="navbar">
			<h1 class="fl">全部商品分类</h1>
			<ul class="navlist fl">
				<li><a href="{% url "goods:index" %}">首页</a></li>
				<li class="interval">|</li>
				<li><a href="#">手机生鲜</a></li>
				<li class="interval">|</li>
				<li><a href="#">抽奖</a></li>
			</ul>
		</div>
	</div>

	<div class="center_con clearfix">
		<ul class="subnav fl">
			{% for type in context.types %}
			<li><a href="#model{{ floor.forloop.counter }}" class="{{ type.logo }}">{{ type.name }}</a></li>
			{% endfor %}
		</ul>
		<div class="slide fl">
			<ul class="slide_pics">

				<li><img src="/static/images/slide.jpg" alt="幻灯片"></li>

			</ul>
			<div class="prev"></div>
			<div class="next"></div>
			<ul class="points"></ul>
		</div>
		<div class="adv fl">
			<a href="#"><img src="/static/images/adv01.jpg"></a>
			<a href="#"><img src="/static/images/adv02.jpg"></a>
		</div>
	</div>


	{% for type in context.types %}
	<div class="list_model">
		<div class="list_title clearfix">
			<h3 class="fl" id="model01">{{ type.name }}</h3>
			<div class="subtitle fl">
				<span>|</span>
				{% for title in type.goods_sku %}
				<a href="detail/{{ goods.id }}">{{ title.name }}</a>
				{% endfor %}
			</div>
			<a href="/list1_1_1/" class="goods_more fr" id="fruit_more">查看更多 ></a>
		</div>

		<div class="goods_con clearfix">
			<div class="goods_banner fl"><img src="/static/{{ type.image }}"></div>
			<ul class="goods_list fl">
				{% for goods in type.goods_sku %}
				<li>
					<h4><a href="detail/{{ goods.id }}">{{ goods.name }}</a></h4>
					<a href="detail/{{ goods.id }}"><img src="/static/{{ goods.image }}"></a>
					<div class="prize">¥ {{ goods.price }}</div>
				</li>
				{% endfor %}

			</ul>
		</div>
	</div>
	{% endfor %}


	<script type="text/javascript" src="/static/js/slide.js"></script>
    <script type="text/javascript">
        BCSlideshow('focuspic');
        var oFruit = document.getElementById('fruit_more');
        var oShownum = document.getElementById('show_count');

        var hasorder = localStorage.getItem('order_finish');

        if(hasorder)
        {
        oShownum.innerHTML = '2';
        }

        oFruit.onclick = function(){
        window.location.href = 'list.html';
        }
    </script>

{% endblock center_body %}
